SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROC [dbo].[_PO_NotComplete]
    @fromdate DATETIME ,
    @todate DATETIME
AS 
    BEGIN
        SELECT  P.PoId ,
                PoDetailId ,
                Pd.DrugId ,
                DrugName ,
                Unit ,
                remainquantity ,
                pd.Remark
        FROM    Podetails Pd
                INNER JOIN Po P ON P.PoId = Pd.PoId
                INNER JOIN dbo.DrugDispo D ON D.DrugId = Pd.DrugId
        WHERE   remainquantity > 0
                AND Podate BETWEEN @fromdate AND @todate
        ORDER BY PoDate
    END
GO
